package com.kaishengit.action;

import java.util.List;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.springframework.beans.factory.annotation.Autowired;

import com.kaishengit.pojo.Task;
import com.kaishengit.service.TaskService;
import com.opensymphony.xwork2.ActionSupport;

@Namespace("/task")
public class TaskAction extends ActionSupport{

	private static final long serialVersionUID = 1L;

	private List<Task> taskList;
	private TaskService taskService;
	
	
	@Action("list")
	public String execute() {
		taskList = taskService.findAll();
		return SUCCESS;
	}
	
	
	//get  set
	public List<Task> getTaskList() {
		return taskList;
	}
	public void setTaskList(List<Task> taskList) {
		this.taskList = taskList;
	}


	public TaskService getTaskService() {
		return taskService;
	}

	@Autowired
	public void setTaskService(TaskService taskService) {
		this.taskService = taskService;
	}
	
	
	
}
